class GiftListModel {
  int? userid;
  String? nickname;
  List<GiftItem>? list;

  GiftListModel({userid, nickname, list});

  GiftListModel.fromJson(Map<String, dynamic> json) {
    userid = json['userid'];
    nickname = json['nickname'];
    if (json['list'] != null) {
      list = <GiftItem>[];
      json['list'].forEach((v) {
        list!.add(GiftItem.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['userid'] = userid;
    data['nickname'] = nickname;
    if (list != null) {
      data['list'] = list!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class GiftItem {
  int? id;
  String? name;
  String? img;
  int? price;
  String? total;

  GiftItem({id, name, img, price, total});

  GiftItem.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    img = json['img'];
    price = json['price'];
    total = json['total'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['id'] = id;
    data['name'] = name;
    data['img'] = img;
    data['price'] = price;
    data['total'] = total;
    return data;
  }
}
